
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>uv_prepare_t — Prepare handle &#8212; libuv documentation</title>
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="uv_check_t — Check handle" href="check.html" />
    <link rel="prev" title="uv_timer_t — Timer handle" href="timer.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="check.html" title="uv_check_t — Check handle"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="timer.html" title="uv_timer_t — Timer handle"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">libuv 1.31.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="api.html" accesskey="U">API documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_prepare_t</span></code> — Prepare handle</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="uv-prepare-t-prepare-handle">
<span id="prepare"></span><h1><a class="reference internal" href="#c.uv_prepare_t" title="uv_prepare_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_prepare_t</span></code></a> — Prepare handle<a class="headerlink" href="#uv-prepare-t-prepare-handle" title="Permalink to this headline">¶</a></h1>
<p>Prepare handles will run the given callback once per loop iteration, right
before polling for i/o.</p>
<div class="section" id="data-types">
<h2>Data types<a class="headerlink" href="#data-types" title="Permalink to this headline">¶</a></h2>
<dl class="c type">
<dt id="c.uv_prepare_t">
<em class="property">type </em><code class="sig-name descname">uv_prepare_t</code><a class="headerlink" href="#c.uv_prepare_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Prepare handle type.</p>
</dd></dl>

<dl class="c type">
<dt id="c.uv_prepare_cb">
<em class="property">typedef </em>void (*<code class="sig-name descname">uv_prepare_cb</code>)<span class="sig-paren">(</span><a class="reference internal" href="#c.uv_prepare_t" title="uv_prepare_t">uv_prepare_t</a> *handle<span class="sig-paren">)</span><a class="headerlink" href="#c.uv_prepare_cb" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Type definition for callback passed to <a class="reference internal" href="#c.uv_prepare_start" title="uv_prepare_start"><code class="xref c c-func docutils literal notranslate"><span class="pre">uv_prepare_start()</span></code></a>.</p>
</dd></dl>

<div class="section" id="public-members">
<h3>Public members<a class="headerlink" href="#public-members" title="Permalink to this headline">¶</a></h3>
<p>N/A</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>The <a class="reference internal" href="handle.html#c.uv_handle_t" title="uv_handle_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_handle_t</span></code></a> members also apply.</p>
</div>
</div>
</div>
<div class="section" id="api">
<h2>API<a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h2>
<dl class="c function">
<dt id="c.uv_prepare_init">
int <code class="sig-name descname">uv_prepare_init</code><span class="sig-paren">(</span><a class="reference internal" href="loop.html#c.uv_loop_t" title="uv_loop_t">uv_loop_t</a> *<em>loop</em>, <a class="reference internal" href="#c.uv_prepare_t" title="uv_prepare_t">uv_prepare_t</a> *<em>prepare</em><span class="sig-paren">)</span><a class="headerlink" href="#c.uv_prepare_init" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Initialize the handle.</p>
</dd></dl>

<dl class="c function">
<dt id="c.uv_prepare_start">
int <code class="sig-name descname">uv_prepare_start</code><span class="sig-paren">(</span><a class="reference internal" href="#c.uv_prepare_t" title="uv_prepare_t">uv_prepare_t</a> *<em>prepare</em>, <a class="reference internal" href="#c.uv_prepare_cb" title="uv_prepare_cb">uv_prepare_cb</a> <em>cb</em><span class="sig-paren">)</span><a class="headerlink" href="#c.uv_prepare_start" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Start the handle with the given callback.</p>
</dd></dl>

<dl class="c function">
<dt id="c.uv_prepare_stop">
int <code class="sig-name descname">uv_prepare_stop</code><span class="sig-paren">(</span><a class="reference internal" href="#c.uv_prepare_t" title="uv_prepare_t">uv_prepare_t</a> *<em>prepare</em><span class="sig-paren">)</span><a class="headerlink" href="#c.uv_prepare_stop" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Stop the handle, the callback will no longer be called.</p>
</dd></dl>

<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>The <a class="reference internal" href="handle.html#c.uv_handle_t" title="uv_handle_t"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_handle_t</span></code></a> API functions also apply.</p>
</div>
</div>
</div>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_prepare_t</span></code> — Prepare handle</a><ul>
<li><a class="reference internal" href="#data-types">Data types</a><ul>
<li><a class="reference internal" href="#public-members">Public members</a></li>
</ul>
</li>
<li><a class="reference internal" href="#api">API</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="timer.html"
                        title="previous chapter"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_timer_t</span></code> — Timer handle</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="check.html"
                        title="next chapter"><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_check_t</span></code> — Check handle</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/prepare.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="check.html" title="uv_check_t — Check handle"
             >next</a> |</li>
        <li class="right" >
          <a href="timer.html" title="uv_timer_t — Timer handle"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">libuv 1.31.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="api.html" >API documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><code class="xref c c-type docutils literal notranslate"><span class="pre">uv_prepare_t</span></code> — Prepare handle</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2014-present, libuv contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
    </div>
  </body>
</html>